<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>Cyc</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_Cyc.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
></TD
><TD CLASS="topbut"
><A HREF="../doc/src/Cyc.html"
>Source code</A
></TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>Cyc</FONT
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
>circular and enumerable
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> (Eq a, Bounded a, Enum a) =&gt; <A HREF="#t%3ACyc"
>Cyc</A
> a  <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="#v%3AsuccCyc"
>succCyc</A
> :: a -&gt; a</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ApredCyc"
>predCyc</A
> :: a -&gt; a</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Ashortest"
>shortest</A
> :: a -&gt; a -&gt; Int</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Apath"
>path</A
> :: Int -&gt; a -&gt; [a]</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ApathFrom"
>pathFrom</A
> :: Bool -&gt; a -&gt; [a]</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3ApathFromTo"
>pathFromTo</A
> :: a -&gt; a -&gt; Maybe Bool -&gt; [a]</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Atravel"
>travel</A
> :: Int -&gt; a -&gt; a</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> (Real r, <A HREF="Cyc.html#t%3ACyc"
>Cyc</A
> a) =&gt; <A HREF="#t%3AMetricCyc"
>MetricCyc</A
> r a  <SPAN CLASS="keyword"
>where</SPAN
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="#v%3AmetricDist"
>metricDist</A
> :: Int -&gt; a -&gt; r</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AloopMetric"
>loopMetric</A
> :: a -&gt; r</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmetricLookup"
>metricLookup</A
> :: [a] -&gt; [r]</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Ametric"
>metric</A
> :: a -&gt; [r]</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmetricDiff"
>metricDiff</A
> :: a -&gt; a -&gt; r</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AmetricTravel"
>metricTravel</A
> :: Integral b =&gt; r -&gt; a -&gt; Maybe (b, a)</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Documentation</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>class</SPAN
> (Eq a, Bounded a, Enum a) =&gt; <A NAME="t:Cyc"
><A NAME="t%3ACyc"
></A
></A
><B
>Cyc</B
> a  <SPAN CLASS="keyword"
>where</SPAN
></TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#Cyc"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>Enum that wraps around
</P
><P
>no minimum definition (completely derivable -- but haskell can't autoderive custom classes?)
</P
><P
>days, months, hours, mins, and secs should use this.
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
>Methods</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:succCyc"
><A NAME="v%3AsuccCyc"
></A
></A
><B
>succCyc</B
> :: a -&gt; a</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#succCyc"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>succ with wraparound
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:predCyc"
><A NAME="v%3ApredCyc"
></A
></A
><B
>predCyc</B
> :: a -&gt; a</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#predCyc"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>pred with wraparound
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:shortest"
><A NAME="v%3Ashortest"
></A
></A
><B
>shortest</B
> :: a -&gt; a -&gt; Int</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#shortest"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>shortest step distance from 1st to 2nd arg (your closest exit may be behind you)
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:path"
><A NAME="v%3Apath"
></A
></A
><B
>path</B
> :: Int -&gt; a -&gt; [a]</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#path"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>list of n steps starting with arg (includes arg, so length of result is (abs n)+1)
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:pathFrom"
><A NAME="v%3ApathFrom"
></A
></A
><B
>pathFrom</B
></TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#pathFrom"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: Bool</TD
><TD CLASS="rdoc"
><TT
>True</TT
> for ascending, <TT
>False</TT
> for descending
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; [a]</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>infinite list of steps starting with arg
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:pathFromTo"
><A NAME="v%3ApathFromTo"
></A
></A
><B
>pathFromTo</B
></TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#pathFromTo"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: a</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>-&gt; Maybe Bool</TD
><TD CLASS="rdoc"
><TT
>Just</TT
> <TT
>True</TT
> for ascending, <TT
>Just</TT
> <TT
>False</TT
> for descending, <TT
>Nothing</TT
> for shortest
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; [a]</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>list of steps in path from 1st to 2nd arg (inclusive)
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:travel"
><A NAME="v%3Atravel"
></A
></A
><B
>travel</B
> :: Int -&gt; a -&gt; a</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#travel"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>transform arg by traveling n steps (n may be negative)
</TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Cyc')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Cyc" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="Cyc.html#t%3ACyc"
>Cyc</A
> <A HREF="Theory.html#t%3APitchClass"
>PitchClass</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Cyc.html#t%3ACyc"
>Cyc</A
> <A HREF="Theory.html#t%3AWhiteKey"
>WhiteKey</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>class</SPAN
> (Real r, <A HREF="Cyc.html#t%3ACyc"
>Cyc</A
> a) =&gt; <A NAME="t:MetricCyc"
><A NAME="t%3AMetricCyc"
></A
></A
><B
>MetricCyc</B
> r a  <SPAN CLASS="keyword"
>where</SPAN
></TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#MetricCyc"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>extend <TT
><A HREF="Cyc.html#t%3ACyc"
>Cyc</A
></TT
> to a nonuniform metric (default is unity)
</P
><P
>no minimum definition (completely derivable -- but haskell can't autoderive custom classes?)
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
>Methods</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:metricDist"
><A NAME="v%3AmetricDist"
></A
></A
><B
>metricDist</B
> :: Int -&gt; a -&gt; r</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#metricDist"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>metric for n steps
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:loopMetric"
><A NAME="v%3AloopMetric"
></A
></A
><B
>loopMetric</B
> :: a -&gt; r</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#loopMetric"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>distance of one ascening trip around the loop
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:metricLookup"
><A NAME="v%3AmetricLookup"
></A
></A
><B
>metricLookup</B
> :: [a] -&gt; [r]</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#metricLookup"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>ascending metrics associated with the elements of the arg
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:metric"
><A NAME="v%3Ametric"
></A
></A
><B
>metric</B
> :: a -&gt; [r]</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#metric"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>specifies the metric associated with ascending motion from each step
</P
><P
>default is every step unity
</P
><P
>BUG: how make static guarantee that the lengths match?
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:metricDiff"
><A NAME="v%3AmetricDiff"
></A
></A
><B
>metricDiff</B
> :: a -&gt; a -&gt; r</TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#metricDiff"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>distance from 1st to 2nd arg, in direction that does not wrap
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:metricTravel"
><A NAME="v%3AmetricTravel"
></A
></A
><B
>metricTravel</B
></TD
><TD CLASS="declbut"
><A HREF="../doc/src/Cyc.html#metricTravel"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="arg"
>:: Integral b</TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="arg"
>=&gt; r</TD
><TD CLASS="rdoc"
>amount of metric to travel
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; a</TD
><TD CLASS="rdoc"
>starting point
</TD
></TR
><TR
><TD CLASS="arg"
>-&gt; Maybe (b, a)</TD
><TD CLASS="rdoc"
><TT
>Just</TT
> (number complete loops,final point) (BUG: currently will not terminate if no exact match, but shoould detect this and return <TT
>Nothing</TT
> (detect by determining that an entire cycle in both directions does not cross the target value))
 it is hilarious how ugly this is!  and this is after refactoring to be idiomatic.  why is this?
</TD
></TR
><TR
><TD CLASS="ndoc" COLSPAN="2"
>self explanatory
</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:MetricCyc')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:MetricCyc" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="Cyc.html#t%3AMetricCyc"
>MetricCyc</A
> Int <A HREF="Theory.html#t%3APitchClass"
>PitchClass</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Cyc.html#t%3AMetricCyc"
>MetricCyc</A
> Int <A HREF="Theory.html#t%3APitchClass"
>PitchClass</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Cyc.html#t%3AMetricCyc"
>MetricCyc</A
> Int <A HREF="Theory.html#t%3AWhiteKey"
>WhiteKey</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="Cyc.html#t%3AMetricCyc"
>MetricCyc</A
> Int <A HREF="Theory.html#t%3AWhiteKey"
>WhiteKey</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.4.2</TD
></TR
></TABLE
></BODY
></HTML
>
